import pymysql
import logging


class Db(object):
    def __init__(self, sql, params=None):
        self.sql = sql
        self.params = params
        self.connect = None
        self.cur = None

    def connectMysql(self):
        try:
            connect = pymysql.connect(host='127.0.0.1', user="root", passwd="root", db="test", port=3306,
                                           charset="utf8")
            print(connect)
        except:
            logging.error("connectDatabase failed")
            return False
